/*
 * main.cpp
 *
 *  Created on: Oct 3, 2014
 *      Author: tanpro
 */
#include <iostream>
#include <fstream>
using namespace std;

void openinfile(ifstream &infile)
{
       char filename[100];
       cout<<"Enter the file name: ";

       cin>>filename;
       infile.open(filename);
}

int main()
{

       ifstream inputfile;

       ofstream outputfile;

       char chs;


       openinfile(inputfile);

       outputfile.open("");


       while (!inputfile.eof())
       {

              inputfile.get(chs);
              if (!inputfile.eof())
              {

                  cout<<chs;
                  // write to output file, samplewrite.txt
                  outputfile<<chs;
              }
       }
       cout<<"\nReading and writing file is completed!"<<endl;
       // close the input file stream
       inputfile.close();
       // close the output file stream
       outputfile.close();
       return 0;
}



